Optimal. Leaf size=53 \[ -\frac {\sqrt {a} \tan ^{-1}\left (\frac {\sqrt {a+b} \tan (c+d x)}{\sqrt {a}}\right )}{(a+b)^{3/2} d}+\frac {\tan (c+d x)}{(a+b) d} \]
[Out]
________________________________________________________________________________________
Rubi [A]
time = 0.05, antiderivative size = 53, normalized size of antiderivative = 1.00, number of steps
used = 3, number of rules used = 3, integrand size = 23, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.130, Rules used = {3274, 327, 211}
\begin {gather*} \frac {\tan (c+d x)}{d (a+b)}-\frac {\sqrt {a} \text {ArcTan}\left (\frac {\sqrt {a+b} \tan (c+d x)}{\sqrt {a}}\right )}{d (a+b)^{3/2}} \end {gather*}
Antiderivative was successfully verified.
[In]
[Out]
Rule 211
Rule 327
Rule 3274
Rubi steps
\begin {align*} \int \frac {\tan ^2(c+d x)}{a+b \sin ^2(c+d x)} \, dx &=\frac {\text {Subst}\left (\int \frac {x^2}{a+(a+b) x^2} \, dx,x,\tan (c+d x)\right )}{d}\\ &=\frac {\tan (c+d x)}{(a+b) d}-\frac {a \text {Subst}\left (\int \frac {1}{a+(a+b) x^2} \, dx,x,\tan (c+d x)\right )}{(a+b) d}\\ &=-\frac {\sqrt {a} \tan ^{-1}\left (\frac {\sqrt {a+b} \tan (c+d x)}{\sqrt {a}}\right )}{(a+b)^{3/2} d}+\frac {\tan (c+d x)}{(a+b) d}\\ \end {align*}
________________________________________________________________________________________
Mathematica [A]
time = 0.11, size = 53, normalized size = 1.00 \begin {gather*} -\frac {\sqrt {a} \tan ^{-1}\left (\frac {\sqrt {a+b} \tan (c+d x)}{\sqrt {a}}\right )}{(a+b)^{3/2} d}+\frac {\tan (c+d x)}{(a+b) d} \end {gather*}
Antiderivative was successfully verified.
[In]
[Out]
________________________________________________________________________________________
Maple [A]
time = 0.50, size = 51, normalized size = 0.96
method | result | size |
derivativedivides | \(\frac {\frac {\tan \left (d x +c \right )}{a +b}-\frac {a \arctan \left (\frac {\tan \left (d x +c \right ) \left (a +b \right )}{\sqrt {a \left (a +b \right )}}\right )}{\left (a +b \right ) \sqrt {a \left (a +b \right )}}}{d}\) | \(51\) |
default | \(\frac {\frac {\tan \left (d x +c \right )}{a +b}-\frac {a \arctan \left (\frac {\tan \left (d x +c \right ) \left (a +b \right )}{\sqrt {a \left (a +b \right )}}\right )}{\left (a +b \right ) \sqrt {a \left (a +b \right )}}}{d}\) | \(51\) |
risch | \(\frac {2 i}{d \left (a +b \right ) \left ({\mathrm e}^{2 i \left (d x +c \right )}+1\right )}-\frac {\sqrt {-a \left (a +b \right )}\, \ln \left ({\mathrm e}^{2 i \left (d x +c \right )}+\frac {2 i \sqrt {-a \left (a +b \right )}-2 a -b}{b}\right )}{2 \left (a +b \right )^{2} d}+\frac {\sqrt {-a \left (a +b \right )}\, \ln \left ({\mathrm e}^{2 i \left (d x +c \right )}-\frac {2 i \sqrt {-a \left (a +b \right )}+2 a +b}{b}\right )}{2 \left (a +b \right )^{2} d}\) | \(127\) |
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Maxima [A]
time = 0.53, size = 51, normalized size = 0.96 \begin {gather*} -\frac {\frac {a \arctan \left (\frac {{\left (a + b\right )} \tan \left (d x + c\right )}{\sqrt {{\left (a + b\right )} a}}\right )}{\sqrt {{\left (a + b\right )} a} {\left (a + b\right )}} - \frac {\tan \left (d x + c\right )}{a + b}}{d} \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Fricas [B] Leaf count of result is larger than twice the leaf count of optimal. 95 vs.
\(2 (45) = 90\).
time = 0.41, size = 300, normalized size = 5.66 \begin {gather*} \left [\frac {\sqrt {-\frac {a}{a + b}} \cos \left (d x + c\right ) \log \left (\frac {{\left (8 \, a^{2} + 8 \, a b + b^{2}\right )} \cos \left (d x + c\right )^{4} - 2 \, {\left (4 \, a^{2} + 5 \, a b + b^{2}\right )} \cos \left (d x + c\right )^{2} + 4 \, {\left ({\left (2 \, a^{2} + 3 \, a b + b^{2}\right )} \cos \left (d x + c\right )^{3} - {\left (a^{2} + 2 \, a b + b^{2}\right )} \cos \left (d x + c\right )\right )} \sqrt {-\frac {a}{a + b}} \sin \left (d x + c\right ) + a^{2} + 2 \, a b + b^{2}}{b^{2} \cos \left (d x + c\right )^{4} - 2 \, {\left (a b + b^{2}\right )} \cos \left (d x + c\right )^{2} + a^{2} + 2 \, a b + b^{2}}\right ) + 4 \, \sin \left (d x + c\right )}{4 \, {\left (a + b\right )} d \cos \left (d x + c\right )}, \frac {\sqrt {\frac {a}{a + b}} \arctan \left (\frac {{\left ({\left (2 \, a + b\right )} \cos \left (d x + c\right )^{2} - a - b\right )} \sqrt {\frac {a}{a + b}}}{2 \, a \cos \left (d x + c\right ) \sin \left (d x + c\right )}\right ) \cos \left (d x + c\right ) + 2 \, \sin \left (d x + c\right )}{2 \, {\left (a + b\right )} d \cos \left (d x + c\right )}\right ] \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Sympy [F]
time = 0.00, size = 0, normalized size = 0.00 \begin {gather*} \int \frac {\tan ^{2}{\left (c + d x \right )}}{a + b \sin ^{2}{\left (c + d x \right )}}\, dx \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Giac [A]
time = 0.61, size = 86, normalized size = 1.62 \begin {gather*} -\frac {\frac {{\left (\pi \left \lfloor \frac {d x + c}{\pi } + \frac {1}{2} \right \rfloor \mathrm {sgn}\left (2 \, a + 2 \, b\right ) + \arctan \left (\frac {a \tan \left (d x + c\right ) + b \tan \left (d x + c\right )}{\sqrt {a^{2} + a b}}\right )\right )} a}{\sqrt {a^{2} + a b} {\left (a + b\right )}} - \frac {\tan \left (d x + c\right )}{a + b}}{d} \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Mupad [B]
time = 14.92, size = 53, normalized size = 1.00 \begin {gather*} \frac {\mathrm {tan}\left (c+d\,x\right )}{d\,\left (a+b\right )}-\frac {\sqrt {a}\,\mathrm {atan}\left (\frac {\mathrm {tan}\left (c+d\,x\right )\,\left (2\,a+2\,b\right )}{2\,\sqrt {a}\,\sqrt {a+b}}\right )}{d\,{\left (a+b\right )}^{3/2}} \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________